<?php if ($this->getReviewsCount()): ?>
    <div class="ratings">
        <?php if ($this->getRatingSummary()):?>
            <div class="rating-box">
                <div class="rating" style="width:<?php echo $this->getRatingSummary() ?>%"></div>
            </div>
        <?php endif;?>
        <span class="amount"><a href="#" onclick="var t = opener ? opener.window : window; t.location.href='<?php echo $this->getReviewsUrl() ?>'; return false;"><?php echo $this->__('%d Review(s)', $this->getReviewsCount()) ?></a></span>
    </div>
<?php elseif ($this->getDisplayIfEmpty()): ?>
    <p class="no-rating"><a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Be the first to review this product') ?></a></p>
<?php else: ?>
    <div class="ratings">
        <div class="rating-box blank-rating">
            <div class="rating" style="width:0%"></div>
        </div>
        <span class="amount blank-rating"><a href="<?php echo $this->getReviewsUrl() ?>#review-form"><?php echo $this->__('Not yet rated') ?></a></span>
    </div>
<?php endif; ?>
